define([
        'app',
        './API'
    ],
    function (app) {
        'use strict';

        app.factory('RenderAPI', ['API', '$resource', function (API, $resource) {
            var server = 'http://malianghang.cn/render';

            function render(name, obj) {
                return $resource(server + '/:name', {name: name}).save(
                    obj
                ).$promise;
            }

            return {
                render: render
            };
        }]);
    });
